/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/


#include "stdafx.h"
#include <pgl/core/PGLColor.h>
#include <pgl/core/PGLArchive.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_DYNCREATE(CPGLColor, CObject);

CPGLColor::ClassicColorMap CPGLColor::m_mClassics;

//! Save settings
void CPGLColor::SerializeXML(CPGLArchive& ar)
{
	static TCHAR szTag[] = _T("CPGLColor");

	CString str;
	markup::CMarkupArchive& xml = *((markup::CMarkupArchive*)ar.GetMarkup());
	// loading own data
	if (ar.IsStoring())
	{
		xml.AddChildElem(szTag);
		xml.IntoElem();

		xml.AddChildElemEx(_T("r"),m_c[0]);
		xml.AddChildElemEx(_T("g"),m_c[1]);
		xml.AddChildElemEx(_T("b"),m_c[2]);
		xml.AddChildElemEx(_T("a"),m_c[3]);

		xml.OutOfElem();
	}
	else
	{
		if  (!xml.FindChildElem(szTag))
				return;

		xml.IntoElem();

		// We should have the right elem...
		if (xml.FindChildElem(_T("r")))
			SetRed(xml.GetChildDataFloat());
		if (xml.FindChildElem(_T("g")))
			SetGreen(xml.GetChildDataFloat());
		if (xml.FindChildElem(_T("b")))
			SetBlue(xml.GetChildDataFloat());
		if (xml.FindChildElem(_T("a")))
			SetAlpha(xml.GetChildDataFloat());

		xml.OutOfElem();
	}
}
#ifdef _DEBUG
void CPGLColor::Dump( CDumpContext& dc ) const
{
    // call base class function first
    CObject::Dump( dc );

    // now do the stuff for our specific class
    dc << "color : "<< m_c[0] <<
				" " << m_c[1] <<
				" " << m_c[2] <<
				" " << m_c[3] << "\n";
}
void CPGLColor::AssertValid() const
{
    // call inherited AssertValid first
    CObject::AssertValid();

    // check members...
    ASSERT( m_c[0]>=0 && m_c[0]<=1); // color is in [0,1]
    ASSERT( m_c[1]>=0 && m_c[1]<=1); // color is in [0,1]
    ASSERT( m_c[2]>=0 && m_c[2]<=1); // color is in [0,1]
    ASSERT( m_c[3]>=0 && m_c[3]<=1); // color is in [0,1]
} 
#endif

#define PGL_RGG255_TO_NORM( a , b , c ) (float)(0x00##a) / 255.0f , (float)(0x00##b) / 255.0f, (float)(0x00##c) / 255.0f

CPGLColor CPGLColor::GetClassicColor( EColor eColor, float fAlpha)
{
	switch(eColor)
	{
	case AliceBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(F0,F8,FF),fAlpha);

	case AntiqueWhite:
		return CPGLColor(PGL_RGG255_TO_NORM(FA,EB,D7),fAlpha);

	case Aqua:
		return CPGLColor(PGL_RGG255_TO_NORM(00,FF,FF),fAlpha);

	case Aquamarine:
		return CPGLColor(PGL_RGG255_TO_NORM(7F,FF,D4),fAlpha);
 
	case Azure:
		return CPGLColor(PGL_RGG255_TO_NORM(F0,FF,FF),fAlpha);
 
	case Beige:
		return CPGLColor(PGL_RGG255_TO_NORM(F5,F5,DC),fAlpha);
 
	case Bisque:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,E4,C4),fAlpha);
 
	case Black:
		return CPGLColor(PGL_RGG255_TO_NORM(00,00,00),fAlpha);
 
	case BlancheDalmond:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,EB,CD),fAlpha);
 
	case Blue:
		return CPGLColor(PGL_RGG255_TO_NORM(00,00,FF),fAlpha);
 
	case BlueViolet:
		return CPGLColor(PGL_RGG255_TO_NORM(8A,2B,E2),fAlpha);
 
	case Brown:
		return CPGLColor(PGL_RGG255_TO_NORM(A5,2A,2A),fAlpha);
 
	case BurlyWood:
		return CPGLColor(PGL_RGG255_TO_NORM(DE,B8,87),fAlpha);
 
	case CadetBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(5F,9E,A0),fAlpha);
 
	case Chartreuse:
		return CPGLColor(PGL_RGG255_TO_NORM(7F,FF,00),fAlpha);
 
	case Chocolate:
		return CPGLColor(PGL_RGG255_TO_NORM(D2,69,1E),fAlpha);
 
	case Coral:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,7F,50),fAlpha);
 
	case CornFlowerBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(64,95,ED),fAlpha);
 
	case CornSilk:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,F8,DC),fAlpha);
 
	case Crimson:
		return CPGLColor(PGL_RGG255_TO_NORM(DC,14,3C),fAlpha);
 
	case Cyan:
		return CPGLColor(PGL_RGG255_TO_NORM(00,FF,FF),fAlpha);
 
	case DarkBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(00,00,8B),fAlpha);
 
	case DarkCyan:
		return CPGLColor(PGL_RGG255_TO_NORM(00,8B,8B),fAlpha);
 
	case DarkGoldenRod:
		return CPGLColor(PGL_RGG255_TO_NORM(B8,86,0B),fAlpha);
 
	case DarkGray:
		return CPGLColor(PGL_RGG255_TO_NORM(A9,A9,A9),fAlpha);
 
	case DarkGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(00,64,00),fAlpha);
 
	case DarkKhaki:
		return CPGLColor(PGL_RGG255_TO_NORM(BD,B7,6B),fAlpha);
 
	case DarkMagenta:
		return CPGLColor(PGL_RGG255_TO_NORM(8B,00,8B),fAlpha);
 
	case DarkOliveGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(55,6B,2F),fAlpha);
 
	case DarkOrange:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,8C,00),fAlpha);
 
	case DarkOrchid:
		return CPGLColor(PGL_RGG255_TO_NORM(99,32,CC),fAlpha);
 
	case DarkRed:
		return CPGLColor(PGL_RGG255_TO_NORM(8B,00,00),fAlpha);
 
	case DarkSalmon:
		return CPGLColor(PGL_RGG255_TO_NORM(E9,96,7A),fAlpha);
 
	case DarkSeaGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(8F,BC,8F),fAlpha);
 
	case DarkSlateBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(48,3D,8B),fAlpha);
 
	case DarkSlateGray:
		return CPGLColor(PGL_RGG255_TO_NORM(2F,4F,4F),fAlpha);
 
	case DarkTurquoise:
		return CPGLColor(PGL_RGG255_TO_NORM(00,CE,D1),fAlpha);
 
	case DarkViolet:
		return CPGLColor(PGL_RGG255_TO_NORM(94,00,D3),fAlpha);
 
	case DeepPink:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,14,93),fAlpha);
 
	case DeepSkyBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(00,BF,FF),fAlpha);
 
	case DimGray:
		return CPGLColor(PGL_RGG255_TO_NORM(69,69,69),fAlpha);
 
	case DodgerBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(1E,90,FF),fAlpha);
 
	case FireBrick:
		return CPGLColor(PGL_RGG255_TO_NORM(B2,22,22),fAlpha);
 
	case FloralWhite:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FA,F0),fAlpha);
 
	case ForestGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(22,8B,22),fAlpha);
 
	case Fuchsia:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,00,FF),fAlpha);
 
	case Gainsboro:
		return CPGLColor(PGL_RGG255_TO_NORM(DC,DC,DC),fAlpha);
 
	case GhostWhite:
		return CPGLColor(PGL_RGG255_TO_NORM(F8,F8,FF),fAlpha);
 
	case Gold:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,D7,00),fAlpha);
 
	case GoldenRod:
		return CPGLColor(PGL_RGG255_TO_NORM(DA,A5,20),fAlpha);
 
	case Gray:
		return CPGLColor(PGL_RGG255_TO_NORM(80,80,80),fAlpha);
 
	case Green:
		return CPGLColor(PGL_RGG255_TO_NORM(00,80,00),fAlpha);
 
	case GreenYellow:
		return CPGLColor(PGL_RGG255_TO_NORM(AD,FF,2F),fAlpha);
 
	case HoneyDew:
		return CPGLColor(PGL_RGG255_TO_NORM(F0,FF,F0),fAlpha);
 
	case HotPink:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,69,B4),fAlpha);
 
	case IndianRed:
		return CPGLColor(PGL_RGG255_TO_NORM(CD,5C,5C),fAlpha);
 
	case Indigo:
		return CPGLColor(PGL_RGG255_TO_NORM(4B,00,82),fAlpha);
 
	case Ivory:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FF,F0),fAlpha);
 
	case Khaki:
		return CPGLColor(PGL_RGG255_TO_NORM(F0,E6,8C),fAlpha);
 
	case Lavender:
		return CPGLColor(PGL_RGG255_TO_NORM(E6,E6,FA),fAlpha);
 
	case LavenderBlush:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,F0,F5),fAlpha);
 
	case LawnGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(7C,FC,00),fAlpha);
 
	case LemonChiffon:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FA,CD),fAlpha);
 
	case LightBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(AD,D8,E6),fAlpha);
 
	case LightCoral:
		return CPGLColor(PGL_RGG255_TO_NORM(F0,80,80),fAlpha);
 
	case LightCyan:
		return CPGLColor(PGL_RGG255_TO_NORM(E0,FF,FF),fAlpha);
 
	case LightGoldenRodYellow:
		return CPGLColor(PGL_RGG255_TO_NORM(FA,FA,D2),fAlpha);
 
	case LightGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(90,EE,90),fAlpha);
 
	case LightGrey:
		return CPGLColor(PGL_RGG255_TO_NORM(D3,D3,D3),fAlpha);
 
	case LightPink:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,B6,C1),fAlpha);
 
	case LightSalmon:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,A0,7A),fAlpha);
 
	case LightSeaGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(20,B2,AA),fAlpha);
 
	case LightSkyBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(87,CE,FA),fAlpha);
 
	case LightSlateGray:
		return CPGLColor(PGL_RGG255_TO_NORM(77,88,99),fAlpha);
 
	case LightSteelBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(B0,C4,DE),fAlpha);
 
	case LightYellow:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FF,E0),fAlpha);
 
	case Lime:
		return CPGLColor(PGL_RGG255_TO_NORM(00,FF,00),fAlpha);
 
	case LimeGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(32,CD,32),fAlpha);
 
	case Linen:
		return CPGLColor(PGL_RGG255_TO_NORM(FA,F0,E6),fAlpha);
 
	case Magenta:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,00,FF),fAlpha);
 
	case Maroon:
		return CPGLColor(PGL_RGG255_TO_NORM(80,00,00),fAlpha);
 
	case MediumAquaMarine:
		return CPGLColor(PGL_RGG255_TO_NORM(66,CD,AA),fAlpha);
 
	case MediumBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(00,00,CD),fAlpha);
 
	case MediumOrchid:
		return CPGLColor(PGL_RGG255_TO_NORM(BA,55,D3),fAlpha);
 
	case MediumPurple:
		return CPGLColor(PGL_RGG255_TO_NORM(93,70,DB),fAlpha);
 
	case MediumSeaGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(3C,B3,71),fAlpha);
 
	case MediumSlateBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(7B,68,EE),fAlpha);
 
	case MediumSpringGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(00,FA,9A),fAlpha);
 
	case MediumTurquoise:
		return CPGLColor(PGL_RGG255_TO_NORM(48,D1,CC),fAlpha);
 
	case MediumVioletRed:
		return CPGLColor(PGL_RGG255_TO_NORM(C7,15,85),fAlpha);
 
	case MidnightBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(19,19,70),fAlpha);
 
	case MintCream:
		return CPGLColor(PGL_RGG255_TO_NORM(F5,FF,FA),fAlpha);
 
	case MistyRose:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,E4,E1),fAlpha);
 
	case Moccasin:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,E4,B5),fAlpha);
 
	case NavajoWhite:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,DE,AD),fAlpha);
 
	case Navy:
		return CPGLColor(PGL_RGG255_TO_NORM(00,00,80),fAlpha);
 
	case OldLace:
		return CPGLColor(PGL_RGG255_TO_NORM(FD,F5,E6),fAlpha);
 
	case Olive:
		return CPGLColor(PGL_RGG255_TO_NORM(80,80,00),fAlpha);
 
	case OliveDrab:
		return CPGLColor(PGL_RGG255_TO_NORM(6B,8E,23),fAlpha);
 
	case Orange:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,A5,00),fAlpha);
 
	case OrangeRed:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,45,00),fAlpha);
 
	case Orchid:
		return CPGLColor(PGL_RGG255_TO_NORM(DA,70,D6),fAlpha);
 
	case PaleGoldenRod:
		return CPGLColor(PGL_RGG255_TO_NORM(EE,E8,AA),fAlpha);
 
	case PaleGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(98,FB,98),fAlpha);
 
	case PaleTurquoise:
		return CPGLColor(PGL_RGG255_TO_NORM(AF,EE,EE),fAlpha);
 
	case PaleVioletRed:
		return CPGLColor(PGL_RGG255_TO_NORM(DB,70,93),fAlpha);
 
	case PapayaWhip:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,EF,D5),fAlpha);
 
	case PeachPuff:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,DA,B9),fAlpha);
 
	case Peru:
		return CPGLColor(PGL_RGG255_TO_NORM(CD,85,3F),fAlpha);
 
	case Pink:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,C0,CB),fAlpha);
 
	case Plum:
		return CPGLColor(PGL_RGG255_TO_NORM(DD,A0,DD),fAlpha);
 
	case PowderBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(B0,E0,E6),fAlpha);
 
	case Purple:
		return CPGLColor(PGL_RGG255_TO_NORM(80,00,80),fAlpha);
 
	case Red:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,00,00),fAlpha);
 
	case RosyBrown:
		return CPGLColor(PGL_RGG255_TO_NORM(BC,8F,8F),fAlpha);
 
	case RoyalBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(41,69,E1),fAlpha);
 
	case SaddleBrown:
		return CPGLColor(PGL_RGG255_TO_NORM(8B,45,13),fAlpha);
 
	case Salmon:
		return CPGLColor(PGL_RGG255_TO_NORM(FA,80,72),fAlpha);
 
	case SandyBrown:
		return CPGLColor(PGL_RGG255_TO_NORM(F4,A4,60),fAlpha);
 
	case SeaGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(2E,8B,57),fAlpha);
 
	case SeaShell:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,F5,EE),fAlpha);
 
	case Sienna:
		return CPGLColor(PGL_RGG255_TO_NORM(A0,52,2D),fAlpha);
 
	case Silver:
		return CPGLColor(PGL_RGG255_TO_NORM(C0,C0,C0),fAlpha);
 
	case SkyBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(87,CE,EB),fAlpha);
 
	case SlateBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(6A,5A,CD),fAlpha);
 
	case SlateGray:
		return CPGLColor(PGL_RGG255_TO_NORM(70,80,90),fAlpha);
 
	case Snow:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FA,FA),fAlpha);
 
	case SpringGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(00,FF,7F),fAlpha);
 
	case SteelBlue:
		return CPGLColor(PGL_RGG255_TO_NORM(46,82,B4),fAlpha);
 
	case Tan:
		return CPGLColor(PGL_RGG255_TO_NORM(D2,B4,8C),fAlpha);
 
	case Teal:
		return CPGLColor(PGL_RGG255_TO_NORM(00,80,80),fAlpha);
 
	case Thistle:
		return CPGLColor(PGL_RGG255_TO_NORM(D8,BF,D8),fAlpha);
 
	case Tomato:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,63,47),fAlpha);
 
	case Turquoise:
		return CPGLColor(PGL_RGG255_TO_NORM(40,E0,D0),fAlpha);
 
	case Violet:
		return CPGLColor(PGL_RGG255_TO_NORM(EE,82,EE),fAlpha);
 
	case Wheat:
		return CPGLColor(PGL_RGG255_TO_NORM(F5,DE,B3),fAlpha);
 
	case White:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FF,FF),fAlpha);
 
	case WhiteSmoke:
		return CPGLColor(PGL_RGG255_TO_NORM(F5,F5,F5),fAlpha);
 
	case Yellow:
		return CPGLColor(PGL_RGG255_TO_NORM(FF,FF,00),fAlpha);
 
	case YellowGreen:
		return CPGLColor(PGL_RGG255_TO_NORM(9A,CD,32),fAlpha); 
	default:
		return CPGLColor(0,0,0);
	}
};

CPGLColor CPGLColor::NextClassicColor()
{
	static EColor eCurColor(AliceBlue);

	eCurColor=static_cast<EColor>(((int)eCurColor+1)%139);

	return GetClassicColor(eCurColor);
}

CPGLColor CPGLColor::StringToColor( LPCTSTR szColor )
{
	// first look for color in classic colors...
	int index;
	float r,g,b,a;
	CString s(szColor);
	s.TrimLeft();
	s.TrimRight();

	ClassicColorMap::const_iterator it = m_mClassics.find( s );
	if (it != m_mClassics.end())
		return GetClassicColor(it->second);

	// it's not a classic color
	// it can be a rgba(..,..,..,..)

	if ( index=s.Find( _T("rgba")) >= 0 )
	{
		szColor=szColor+index+4;
		if (_stscanf( szColor, _T("%f,%f,%f,%f"), &r,&g,&b,&a)==4)
			return CPGLColor( 
				static_cast<float>(r/255.0), 
				static_cast<float>(g/255.0), 
				static_cast<float>(b/255.0),
				static_cast<float>(a/255.0) );
	}
	else if ( index=s.Find( _T("rgb")) >= 0 )
	{
		szColor=szColor+index+3;
		if (_stscanf( szColor, _T("%f,%f,%f"), &r,&g,&b)==3)
			return CPGLColor( 
				static_cast<float>(r/255.0), 
				static_cast<float>(g/255.0), 
				static_cast<float>(b/255.0) );
	}

	return CPGLColor(0,0,0);
};

void CPGLColor::PrepareClassicColors()
{
	if (!m_mClassics.empty())
		return;
	
	m_mClassics[_T("AliceBlue")]=AliceBlue;
	m_mClassics[_T("AntiqueWhite")]=AntiqueWhite;
	m_mClassics[_T("Aqua")]=Aqua;
	m_mClassics[_T("Aquamarine")]=Aquamarine;
	m_mClassics[_T("Azure")]=Azure;
	m_mClassics[_T("Beige")]=Beige;
	m_mClassics[_T("Bisque")]=Bisque;
	m_mClassics[_T("Black")]=Black;
	m_mClassics[_T("BlancheDalmond")]=BlancheDalmond;
	m_mClassics[_T("Blue")]=Blue;
	m_mClassics[_T("BlueViolet")]=BlueViolet;
	m_mClassics[_T("Brown")]=Brown;
	m_mClassics[_T("BurlyWood")]=BurlyWood;
	m_mClassics[_T("CadetBlue")]=CadetBlue;
	m_mClassics[_T("Chartreuse")]=Chartreuse;
	m_mClassics[_T("Chocolate")]=Chocolate;
	m_mClassics[_T("Coral")]=Coral;
	m_mClassics[_T("CornFlowerBlue")]=CornFlowerBlue;
	m_mClassics[_T("CornSilk")]=CornSilk;
	m_mClassics[_T("Crimson")]=Crimson;
	m_mClassics[_T("Cyan")]=Cyan;
	m_mClassics[_T("DarkBlue")]=DarkBlue;
	m_mClassics[_T("DarkCyan")]=DarkCyan;
	m_mClassics[_T("DarkGoldenRod")]=DarkGoldenRod;
	m_mClassics[_T("DarkGray")]=DarkGray;
	m_mClassics[_T("DarkGreen")]=DarkGreen;
	m_mClassics[_T("DarkKhaki")]=DarkKhaki;
	m_mClassics[_T("DarkMagenta")]=DarkMagenta;
	m_mClassics[_T("DarkOliveGreen")]=DarkOliveGreen;
	m_mClassics[_T("DarkOrange")]=DarkOrange;
	m_mClassics[_T("DarkOrchid")]=DarkOrchid;
	m_mClassics[_T("DarkRed")]=DarkRed;
	m_mClassics[_T("DarkSalmon")]=DarkSalmon;
	m_mClassics[_T("DarkSeaGreen")]=DarkSeaGreen;
	m_mClassics[_T("DarkSlateBlue")]=DarkSlateBlue;
	m_mClassics[_T("DarkSlateGray")]=DarkSlateGray;
	m_mClassics[_T("DarkTurquoise")]=DarkTurquoise;
	m_mClassics[_T("DarkViolet")]=DarkViolet;
	m_mClassics[_T("DeepPink")]=DeepPink;
	m_mClassics[_T("DeepSkyBlue")]=DeepSkyBlue;
	m_mClassics[_T("DimGray")]=DimGray;
	m_mClassics[_T("DodgerBlue")]=DodgerBlue;
	m_mClassics[_T("FireBrick")]=FireBrick;
	m_mClassics[_T("FloralWhite")]=FloralWhite;
	m_mClassics[_T("ForestGreen")]=ForestGreen;
	m_mClassics[_T("Fuchsia")]=Fuchsia;
	m_mClassics[_T("Gainsboro")]=Gainsboro;
	m_mClassics[_T("GhostWhite")]=GhostWhite;
	m_mClassics[_T("Gold")]=Gold;
	m_mClassics[_T("GoldenRod")]=GoldenRod;
	m_mClassics[_T("Gray")]=Gray;
	m_mClassics[_T("Green")]=Green;
	m_mClassics[_T("GreenYellow")]=GreenYellow;
	m_mClassics[_T("HoneyDew")]=HoneyDew;
	m_mClassics[_T("HotPink")]=HotPink;
	m_mClassics[_T("IndianRed")]=IndianRed;
	m_mClassics[_T("Indigo")]=Indigo;
	m_mClassics[_T("Ivory")]=Ivory;
	m_mClassics[_T("Khaki")]=Khaki;
	m_mClassics[_T("Lavender")]=Lavender;
	m_mClassics[_T("LavenderBlush")]=LavenderBlush;
	m_mClassics[_T("LawnGreen")]=LawnGreen;
	m_mClassics[_T("LemonChiffon")]=LemonChiffon;
	m_mClassics[_T("LightBlue")]=LightBlue;
	m_mClassics[_T("LightCoral")]=LightCoral;
	m_mClassics[_T("LightCyan")]=LightCyan;
	m_mClassics[_T("LightGoldenRodYellow")]=LightGoldenRodYellow;
	m_mClassics[_T("LightGreen")]=LightGreen;
	m_mClassics[_T("LightGrey")]=LightGrey;
	m_mClassics[_T("LightPink")]=LightPink;
	m_mClassics[_T("LightSalmon")]=LightSalmon;
	m_mClassics[_T("LightSeaGreen")]=LightSeaGreen;
	m_mClassics[_T("LightSkyBlue")]=LightSkyBlue;
	m_mClassics[_T("LightSlateGray")]=LightSlateGray;
	m_mClassics[_T("LightSteelBlue")]=LightSteelBlue;
	m_mClassics[_T("LightYellow")]=LightYellow;
	m_mClassics[_T("Lime")]=Lime;
	m_mClassics[_T("LimeGreen")]=LimeGreen;
	m_mClassics[_T("Linen")]=Linen;
	m_mClassics[_T("Magenta")]=Magenta;
	m_mClassics[_T("Maroon")]=Maroon;
	m_mClassics[_T("MediumAquaMarine")]=MediumAquaMarine;
	m_mClassics[_T("MediumBlue")]=MediumBlue;
	m_mClassics[_T("MediumOrchid")]=MediumOrchid;
	m_mClassics[_T("MediumPurple")]=MediumPurple;
	m_mClassics[_T("MediumSeaGreen")]=MediumSeaGreen;
	m_mClassics[_T("MediumSlateBlue")]=MediumSlateBlue;
	m_mClassics[_T("MediumSpringGreen")]=MediumSpringGreen;
	m_mClassics[_T("MediumTurquoise")]=MediumTurquoise;
	m_mClassics[_T("MediumVioletRed")]=MediumVioletRed;
	m_mClassics[_T("MidnightBlue")]=MidnightBlue;
	m_mClassics[_T("MintCream")]=MintCream;
	m_mClassics[_T("MistyRose")]=MistyRose;
	m_mClassics[_T("Moccasin")]=Moccasin;
	m_mClassics[_T("NavajoWhite")]=NavajoWhite;
	m_mClassics[_T("Navy")]=Navy;
	m_mClassics[_T("OldLace")]=OldLace;
	m_mClassics[_T("Olive")]=Olive;
	m_mClassics[_T("OliveDrab")]=OliveDrab;
	m_mClassics[_T("Orange")]=Orange;
	m_mClassics[_T("OrangeRed")]=OrangeRed;
	m_mClassics[_T("Orchid")]=Orchid;
	m_mClassics[_T("PaleGoldenRod")]=PaleGoldenRod;
	m_mClassics[_T("PaleGreen")]=PaleGreen;
	m_mClassics[_T("PaleTurquoise")]=PaleTurquoise;
	m_mClassics[_T("PaleVioletRed")]=PaleVioletRed;
	m_mClassics[_T("PapayaWhip")]=PapayaWhip;
	m_mClassics[_T("PeachPuff")]=PeachPuff;
	m_mClassics[_T("Peru")]=Peru;
	m_mClassics[_T("Pink")]=Pink;
	m_mClassics[_T("Plum")]=Plum;
	m_mClassics[_T("PowderBlue")]=PowderBlue;
	m_mClassics[_T("Purple")]=Purple;
	m_mClassics[_T("Red")]=Red;
	m_mClassics[_T("RosyBrown")]=RosyBrown;
	m_mClassics[_T("RoyalBlue")]=RoyalBlue;
	m_mClassics[_T("SaddleBrown")]=SaddleBrown;
	m_mClassics[_T("Salmon")]=Salmon;
	m_mClassics[_T("SandyBrown")]=SandyBrown;
	m_mClassics[_T("SeaGreen")]=SeaGreen;
	m_mClassics[_T("SeaShell")]=SeaShell;
	m_mClassics[_T("Sienna")]=Sienna;
	m_mClassics[_T("Silver")]=Silver;
	m_mClassics[_T("SkyBlue")]=SkyBlue;
	m_mClassics[_T("SlateBlue")]=SlateBlue;
	m_mClassics[_T("SlateGray")]=SlateGray;
	m_mClassics[_T("Snow")]=Snow;
	m_mClassics[_T("SpringGreen")]=SpringGreen;
	m_mClassics[_T("SteelBlue")]=SteelBlue;
	m_mClassics[_T("Tan")]=Tan;
	m_mClassics[_T("Teal")]=Teal;
	m_mClassics[_T("Thistle")]=Thistle;
	m_mClassics[_T("Tomato")]=Tomato;
	m_mClassics[_T("Turquoise")]=Turquoise;
	m_mClassics[_T("Violet")]=Violet;
	m_mClassics[_T("Wheat")]=Wheat;
	m_mClassics[_T("White")]=White;
	m_mClassics[_T("WhiteSmoke")]=WhiteSmoke;
	m_mClassics[_T("Yellow")]=Yellow;
	m_mClassics[_T("YellowGreen")]=YellowGreen;
};
